//封装获取频道列表的逻辑
import { useState,useEffect } from 'react'
import {getChannelAPI} from '@/apis/article'
function useChannel() {
    const [channelList,setChannelList] = useState([])//频道列表
    useEffect(() => {
        getChannelAPI().then(res => {
            setChannelList(res.data.channels)  
        })
      }, [])
      return {
        channelList
      }
}
export { useChannel }